package io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 *
 */
public class Test3 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("note.txt");
        FileInputStream fis = new FileInputStream("note.txt");
        while (true){
            System.out.println("请录入数据:");
            Scanner scan = new Scanner(System.in);
            String line =scan.nextLine();
            String stop = "exit";
            if (line.equals(stop)){
                break;
            }
            byte [] data = line.getBytes(StandardCharsets.UTF_8);
            fos.write(data);

        }
        System.out.println("再见");
        fos.close();

    }




}
